Skip to content

Potential fix for code scanning alert no. 5: Too few arguments to formatting function#35

Merged
amikhail48 merged 1 commit intomainfrom
alert-autofix-5
Mar 13, 2026
Merged

Potential fix for code scanning alert no. 5: Too few arguments to formatting function#35
amikhail48 merged 1 commit intomainfrom
alert-autofix-5

Conversation

@amikhail48
Copy link
Member

Potential fix for https://github.com/RunEdgeAI/coreflow/security/code-scanning/5

To fix the problem, the number and types of arguments passed to vxAddLogEntry must match the format specifiers in its format string. The simplest and safest fix that preserves existing behavior is to add the missing arguments corresponding to the %ux%u placeholders (destination width and height), similar to how the source-dimension log message just above should logically work.

Concretely, in framework/src/vx_graph.cpp at the VX_TYPE_REMAP section, locate the if (remap->dst_width != ... block and its vxAddLogEntry call:

vxAddLogEntry(reinterpret_cast<vx_reference>(this), VX_ERROR_INVALID_DIMENSION,
    "Node: %s: parameter[%u] has an invalid destination dimention %ux%u",
    nodes[n]->kernel->name, p);

This format string has four specifiers: %s, %u, %u, %u. We already pass arguments for the first two (nodes[n]->kernel->name, p), but not for the last two (%ux%u). The correct behavior is to log the actual destination width and height that were found to be invalid, which are remap->dst_width and remap->dst_height. Therefore, we should extend the argument list to:

    nodes[n]->kernel->name, p, remap->dst_width, remap->dst_height);

No new includes or type definitions are needed; remap, dst_width, and dst_height are already in scope and properly typed in this context. This change aligns this log message with the pattern used in the nearby source-dimension log and fixes the formatting-function argument count error without altering control flow or semantics beyond improving the log contents.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…matting function

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@amikhail48 amikhail48 marked this pull request as ready for review March 8, 2026 05:40
@amikhail48 amikhail48 merged commit 9113909 into main Mar 13, 2026
8 of 9 checks passed
@amikhail48 amikhail48 deleted the alert-autofix-5 branch March 13, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant